/**
 * <copyright>
 * </copyright>
 *

 */
package info.unlp.tesis.qvtoperational.util;

import info.unlp.tesis.qvtoperational.*;

import java.util.List;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;

/**
 * <!-- begin-user-doc -->
 * The <b>Switch</b> for the model's inheritance hierarchy.
 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
 * to invoke the <code>caseXXX</code> method for each class of the model,
 * starting with the actual class of the object
 * and proceeding up the inheritance hierarchy
 * until a non-null result is returned,
 * which is the result of the switch.
 * <!-- end-user-doc -->
 * @see info.unlp.tesis.qvtoperational.QvtoperationalPackage
 * @generated
 */
public class QvtoperationalSwitch<T>
{
  /**
   * The cached model package
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected static QvtoperationalPackage modelPackage;

  /**
   * Creates an instance of the switch.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public QvtoperationalSwitch()
  {
    if (modelPackage == null)
    {
      modelPackage = QvtoperationalPackage.eINSTANCE;
    }
  }

  /**
   * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @return the first non-null result returned by a <code>caseXXX</code> call.
   * @generated
   */
  public T doSwitch(EObject theEObject)
  {
    return doSwitch(theEObject.eClass(), theEObject);
  }

  /**
   * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @return the first non-null result returned by a <code>caseXXX</code> call.
   * @generated
   */
  protected T doSwitch(EClass theEClass, EObject theEObject)
  {
    if (theEClass.eContainer() == modelPackage)
    {
      return doSwitch(theEClass.getClassifierID(), theEObject);
    }
    else
    {
      List<EClass> eSuperTypes = theEClass.getESuperTypes();
      return
        eSuperTypes.isEmpty() ?
          defaultCase(theEObject) :
          doSwitch(eSuperTypes.get(0), theEObject);
    }
  }

  /**
   * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @return the first non-null result returned by a <code>caseXXX</code> call.
   * @generated
   */
  protected T doSwitch(int classifierID, EObject theEObject)
  {
    switch (classifierID)
    {
      case QvtoperationalPackage.OPERATIONAL_TRANSFORMATION:
      {
        OperationalTransformation operationalTransformation = (OperationalTransformation)theEObject;
        T result = caseOperationalTransformation(operationalTransformation);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.VAR_PARAMETER:
      {
        VarParameter varParameter = (VarParameter)theEObject;
        T result = caseVarParameter(varParameter);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.MODEL_PARAMETER:
      {
        ModelParameter modelParameter = (ModelParameter)theEObject;
        T result = caseModelParameter(modelParameter);
        if (result == null) result = caseVarParameter(modelParameter);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.MODEL_TYPE:
      {
        ModelType modelType = (ModelType)theEObject;
        T result = caseModelType(modelType);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.IMPERATIVE_OPERATION:
      {
        ImperativeOperation imperativeOperation = (ImperativeOperation)theEObject;
        T result = caseImperativeOperation(imperativeOperation);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.OPERATION_BODY:
      {
        OperationBody operationBody = (OperationBody)theEObject;
        T result = caseOperationBody(operationBody);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.ENTRY_OPERATION:
      {
        EntryOperation entryOperation = (EntryOperation)theEObject;
        T result = caseEntryOperation(entryOperation);
        if (result == null) result = caseImperativeOperation(entryOperation);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.OCL_EXPRESSION:
      {
        OCLExpression oclExpression = (OCLExpression)theEObject;
        T result = caseOCLExpression(oclExpression);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.IF_EXP:
      {
        IfExp ifExp = (IfExp)theEObject;
        T result = caseIfExp(ifExp);
        if (result == null) result = caseImperativeExpression(ifExp);
        if (result == null) result = caseOCLExpression(ifExp);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.ASSIGN_EXP:
      {
        AssignExp assignExp = (AssignExp)theEObject;
        T result = caseAssignExp(assignExp);
        if (result == null) result = caseImperativeExpression(assignExp);
        if (result == null) result = caseOCLExpression(assignExp);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.IMPERATIVE_EXPRESSION:
      {
        ImperativeExpression imperativeExpression = (ImperativeExpression)theEObject;
        T result = caseImperativeExpression(imperativeExpression);
        if (result == null) result = caseOCLExpression(imperativeExpression);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.NULL_EXP:
      {
        NullExp nullExp = (NullExp)theEObject;
        T result = caseNullExp(nullExp);
        if (result == null) result = caseImperativeExpression(nullExp);
        if (result == null) result = caseOCLExpression(nullExp);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.BREAK_EXP:
      {
        BreakExp breakExp = (BreakExp)theEObject;
        T result = caseBreakExp(breakExp);
        if (result == null) result = caseImperativeExpression(breakExp);
        if (result == null) result = caseOCLExpression(breakExp);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.CONTINUE_EXP:
      {
        ContinueExp continueExp = (ContinueExp)theEObject;
        T result = caseContinueExp(continueExp);
        if (result == null) result = caseImperativeExpression(continueExp);
        if (result == null) result = caseOCLExpression(continueExp);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.WHILE_EXP:
      {
        WhileExp whileExp = (WhileExp)theEObject;
        T result = caseWhileExp(whileExp);
        if (result == null) result = caseImperativeExpression(whileExp);
        if (result == null) result = caseOCLExpression(whileExp);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.BOOLEAN_LITERAL_EXP:
      {
        BooleanLiteralExp booleanLiteralExp = (BooleanLiteralExp)theEObject;
        T result = caseBooleanLiteralExp(booleanLiteralExp);
        if (result == null) result = caseOCLExpression(booleanLiteralExp);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.VARIABLE_INIT_EXP:
      {
        VariableInitExp variableInitExp = (VariableInitExp)theEObject;
        T result = caseVariableInitExp(variableInitExp);
        if (result == null) result = caseImperativeExpression(variableInitExp);
        if (result == null) result = caseOCLExpression(variableInitExp);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.VARIABLE_WITH_TYPE:
      {
        VariableWithType variableWithType = (VariableWithType)theEObject;
        T result = caseVariableWithType(variableWithType);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.DATA_TYPE:
      {
        DataType dataType = (DataType)theEObject;
        T result = caseDataType(dataType);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.VARIABLE:
      {
        Variable variable = (Variable)theEObject;
        T result = caseVariable(variable);
        if (result == null) result = caseImperativeExpression(variable);
        if (result == null) result = caseOCLExpression(variable);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.STRING_LITERAL_EXP:
      {
        StringLiteralExp stringLiteralExp = (StringLiteralExp)theEObject;
        T result = caseStringLiteralExp(stringLiteralExp);
        if (result == null) result = caseOCLExpression(stringLiteralExp);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.INTEGER_LITERAL_EXP:
      {
        IntegerLiteralExp integerLiteralExp = (IntegerLiteralExp)theEObject;
        T result = caseIntegerLiteralExp(integerLiteralExp);
        if (result == null) result = caseOCLExpression(integerLiteralExp);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case QvtoperationalPackage.OPERATION_CALL_EXP:
      {
        OperationCallExp operationCallExp = (OperationCallExp)theEObject;
        T result = caseOperationCallExp(operationCallExp);
        if (result == null) result = caseOCLExpression(operationCallExp);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      default: return defaultCase(theEObject);
    }
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Operational Transformation</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Operational Transformation</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseOperationalTransformation(OperationalTransformation object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Var Parameter</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Var Parameter</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseVarParameter(VarParameter object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Model Parameter</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Model Parameter</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseModelParameter(ModelParameter object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Model Type</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Model Type</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseModelType(ModelType object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Imperative Operation</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Imperative Operation</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseImperativeOperation(ImperativeOperation object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Operation Body</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Operation Body</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseOperationBody(OperationBody object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Entry Operation</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Entry Operation</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseEntryOperation(EntryOperation object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>OCL Expression</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>OCL Expression</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseOCLExpression(OCLExpression object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>If Exp</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>If Exp</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseIfExp(IfExp object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Assign Exp</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Assign Exp</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseAssignExp(AssignExp object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Imperative Expression</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Imperative Expression</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseImperativeExpression(ImperativeExpression object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Null Exp</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Null Exp</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseNullExp(NullExp object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Break Exp</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Break Exp</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseBreakExp(BreakExp object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Continue Exp</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Continue Exp</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseContinueExp(ContinueExp object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>While Exp</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>While Exp</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseWhileExp(WhileExp object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Boolean Literal Exp</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Boolean Literal Exp</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseBooleanLiteralExp(BooleanLiteralExp object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Variable Init Exp</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Variable Init Exp</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseVariableInitExp(VariableInitExp object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Variable With Type</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Variable With Type</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseVariableWithType(VariableWithType object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Data Type</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Data Type</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseDataType(DataType object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Variable</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Variable</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseVariable(Variable object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>String Literal Exp</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>String Literal Exp</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseStringLiteralExp(StringLiteralExp object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Integer Literal Exp</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Integer Literal Exp</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseIntegerLiteralExp(IntegerLiteralExp object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Operation Call Exp</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Operation Call Exp</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseOperationCallExp(OperationCallExp object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch, but this is the last case anyway.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject)
   * @generated
   */
  public T defaultCase(EObject object)
  {
    return null;
  }

} //QvtoperationalSwitch
